<template>
	<view class="content">
		<view class="process" v-if="lisData.seller_state!=4">
			<view class="flexsb processTitle">				                                   
				<view :class="[(lisData.refund_state == 1) ? 'processActive' : '']" class="processActive">买家申请</view>
				<view :class="[(lisData.refund_state >= 2) ? 'processActive' : '']" class="">商家处理</view>
				<view :class="[(lisData.refund_state == 3) ? 'processActive' : '']" class="">确认收货</view>
			</view>
			<view class="flexsb processTitle">
				<view :class="[(lisData.refund_state == 1) ? 'processActive' : '']" class="processActive">换货</view>
				<view :class="[(lisData.refund_state >= 2) ? 'processActive' : '']" class="">换货申请</view>
				<view :class="[(lisData.refund_state == 3) ? 'processActive' : '']" class="">换货完成</view>
			</view>

			<view v-if="lisData.refund_state == 1"  style=" position: relative;z-index: 0;top: 40upx;width: 680upx;height: 2upx;margin: 0 auto;" class="progress-box">
				<progress activeColor="#ff4300" percent="0" stroke-width="2" />
			</view>
			<view v-if="lisData.refund_state == 2"  style=" position: relative;z-index: 0;top: 40upx;width: 680upx;height: 2upx;margin: 0 auto;" class="progress-box">
				<progress activeColor="#ff4300" percent="50" stroke-width="2" />
			</view>
			<view v-if="lisData.refund_state == 3"  style=" position: relative;z-index: 0;top: 40upx;width: 680upx;height: 2upx;margin: 0 auto;" class="progress-box">
				<progress activeColor="#ff4300" percent="100" stroke-width="2" />
			</view>


			<view v-if="lisData.refund_state == 1" class="flexsb circles">
				<view style="z-index: 1;">
					<image v-if="true" style="width: 40upx;height: 40upx;" src="/static/images/login/xuanzhong-icon.png" mode=""></image>
					<image v-if="false" style="width: 40upx;height: 40upx;" src="/static/images/new_tousugg2.jpg" mode=""></image>
				</view>
				<view style="z-index: 1;">
					<image v-if="false" style="width: 40upx;height: 40upx;" src="/static/images/login/xuanzhong-icon.png" mode=""></image>
					<image v-if="true" style="width: 40upx;height: 40upx;" src="/static/images/new_tousugg2.jpg" mode=""></image>
				</view>
				<view style="z-index: 1;">
					<image v-if="false" style="width: 40upx;height: 40upx;" src="/static/images/login/xuanzhong-icon.png" mode=""></image>
					<image v-if="true" style="width: 40upx;height: 40upx;" src="/static/images/new_tousugg2.jpg" mode=""></image>
				</view>
			</view>
			<view v-if="lisData.refund_state == 2" class="flexsb circles">
				<view style="z-index: 1;">
					<image v-if="true" style="width: 40upx;height: 40upx;" src="/static/images/login/xuanzhong-icon.png" mode=""></image>
					<image v-if="false" style="width: 40upx;height: 40upx;" src="/static/images/new_tousugg2.jpg" mode=""></image>
				</view>
				<view style="z-index: 1;">
					<image v-if="true" style="width: 40upx;height: 40upx;" src="/static/images/login/xuanzhong-icon.png" mode=""></image>
					<image v-if="false" style="width: 40upx;height: 40upx;" src="/static/images/new_tousugg2.jpg" mode=""></image>
				</view>
				<view style="z-index: 1;">
					<image v-if="false" style="width: 40upx;height: 40upx;" src="/static/images/login/xuanzhong-icon.png" mode=""></image>
					<image v-if="true" style="width: 40upx;height: 40upx;" src="/static/images/new_tousugg2.jpg" mode=""></image>
				</view>
			</view>
			<view v-if="lisData.refund_state == 3" class="flexsb circles">
				<view style="z-index: 1;">
					<image v-if="true" style="width: 40upx;height: 40upx;" src="/static/images/login/xuanzhong-icon.png" mode=""></image>
					<image v-if="false" style="width: 40upx;height: 40upx;" src="/static/images/new_tousugg2.jpg" mode=""></image>
				</view>
				<view style="z-index: 1;">
					<image v-if="true" style="width: 40upx;height: 40upx;" src="/static/images/login/xuanzhong-icon.png" mode=""></image>
					<image v-if="false" style="width: 40upx;height: 40upx;" src="/static/images/new_tousugg2.jpg" mode=""></image>
				</view>
				<view style="z-index: 1;">
					<image v-if="true" style="width: 40upx;height: 40upx;" src="/static/images/login/xuanzhong-icon.png" mode=""></image>
					<image v-if="false" style="width: 40upx;height: 40upx;" src="/static/images/new_tousugg2.jpg" mode=""></image>
				</view>
			</view>
		</view>
			
		<view class="commonTitle fs18 C333">
			我的换货申请
		</view>	
		<view class="commonBox">
			<view class="fs18 C999 lh40">
				换货编号：{{lisData.refund_sn}}
			</view>
			<view class="fs18 C999 lh40">
				换货原因：{{lisData.reason_info}}
			</view>
			<view class="fs18 C999 lh40">
				换货金额：{{lisData.refund_amount}}
			</view>
			<view class="fs18 C999 lh40">
				换货说明：{{lisData.buyer_message}}
			</view>
			<view v-if="lisData.seller_state==4" class="fs18 C999 lh40">
				状态：已取消
			</view>
			<view class="fs18 C999 lh40">
				凭证上传：
			</view>
			<view v-if="lisData.pic_list" style="display: flex;">
				<view v-for="(item2,index2) in lisData.pic_list" :key="index2" style="width: 236upx;height: 220upx;text-align: center;" class="">
					<image style="width: 220upx;height: 220upx;border: 1upx solid #f4f4f4;" :src="item2.imgurl" mode=""></image>
				</view>
			</view>
		</view>		
		
		<view class="commonTitle fs18 C333" v-if="lisData.seller_state!=4">
			商家换货处理
		</view>	
		<view class="commonBox" v-if="lisData.seller_state!=4">
			<view class="fs18 C999 lh40 flexBox">
				<view class="">
					审核状态：
					<text v-if="lisData.seller_state == 1 ">待审核</text>
					<text v-if="lisData.seller_state == 2 ">已通过</text>
					<text v-if="lisData.seller_state == 3 ">已拒绝</text>
				</view>
			
				<view class="logisticsInfo" @click="ToInfo()" v-if="lisData.seller_state ==2&&lisData.goods_state <2&&lisData.refund_type==3">填写发货信息</view>
				<view class="logisticsInfo" v-if="lisData.seller_state ==2&&lisData.goods_state>=2" style="background-color: #cfcfcd;">已填写发货信息</view>
				 <!-- v-if="lisData.seller_state == 2   goods_state" -->
			</view>
			
			<view class="fs18 C999 lh40">
				商家备注：{{lisData.seller_message}}
			</view>		
		</view>
		
	<!-- 	<view class="commonTitle fs18 C333">
			商城换货审核
		</view>	
		<view class="commonBox">
			<view class="fs18 C999 lh40">
				平台确认：
				<text v-if="lisData.refund_state == 1">处理中</text>
				<text v-if="lisData.refund_state == 2">待管理员处理</text>
				<text v-if="lisData.refund_state == 3">已完成</text>
			</view>
			<view class="fs18 C999 lh40">
				平台备注：{{lisData.admin_message}}
			</view>
		</view> -->
		<view class="commonTitle fs18 C333" v-if="lisData.return_type==2&&lisData.seller_state!=4">
			我的退货发货信息
		</view>	
		<view class="commonBox flexBox" v-if="lisData.return_type==2&&lisData.seller_state!=4">
			<view class="fs18 C999 lh40">
				物流信息：{{lisData.express_name||""}}{{lisData.express_name?',':''}}{{lisData.invoice_no||""}}
			</view>
			<!-- v-if="lisData.return_type=2&&lisData.seller_state==2" -->
			<!-- <view class="Button" @click="Button()" v-if="lisData.return_type=2&&lisData.seller_state==2">填写物流单号</view> -->
			<view class="Button" @click="Button()" v-if="lisData.return_type==2&&lisData.seller_state==2&&lisData.goods_state==1">填写物流单号</view><view v-if="lisData.invoice_no" @click="Towuliu(1)">查看物流</view>
			
		</view>
		<view class="commonTitle fs18 C333" v-if="lisData.seller_state!=4">
			商家发货
		</view>	
		<view class="commonBox" v-if="lisData.seller_state!=4">
			<view class="fs18 C999 lh40 flexBox">
				<view v-if="lisData.seller_goods_state == 1" class="">发货状态：待发货</view>
				<view v-if="lisData.seller_goods_state == 2">发货状态：已发货  </view>
				<view v-if="lisData.seller_goods_state == 4">发货状态：已收货</view>
				<view class="flexBox" v-if="lisData.seller_goods_state == 2"><view class="logisticsInfo" @click="Towuliu(2)">查看物流</view><view class="logisticsInfo" @click="Receipt()">确认收货</view></view>
				<view class="flexBox" v-if="lisData.seller_goods_state == 4" ><view class="complete">已完成</view></view>
			</view>
		</view>
		<view style="padding-left: 30upx;" class="fs22 bold C999 lh80">
			提示：
		</view>
		<view class="commonTip C999 lh40 fs18">
			1.若提出申请后，商家拒绝换货或退货，可再次提交申请或选择“<text class="C333 bold">商品投诉</text>”，请求商城客服人员介入。
		</view>
		<view class="commonTip C999 lh40 fs18">
			2.成功完成换货/退货：经过商城审核后，会将换货金额以“<text class="C333 bold">预存款</text>”的形式返还到您的余额账户中（礼品卡部分只能退回到礼品卡余额）。
		</view>
	</view>
	
	
</template>

<script>
	export default {
		data(){
			return{
				lisData:[],
				refundId:"",
				lis:[],
				id:'',
				active2flag:0,
				express_list:"",
			}
		},
		onLoad(options) {
			if(options.refundId){
				this.refundId=options.refundId
			}
			if(options.express_list){
				this.express_list=options.express_list
			}
			var that=this;
			this.$util.request({
				url: '/mobile/index.php?act=member_exchange&op=view',
				method: 'get',
				data: {
					"return_id":this.refundId				
				},
			}).then(function(res) {
				if(res.error_code==0){
					that.lisData=res.datas.info
				}else{
					uni.showToast({
						title:res.message,
						icon:"none"
					})
				}
			})
			
		},
		onShow() {
		},
		methods:{
			Receipt(){//确认收货
				this.$util.request({
					url: '/mobile/index.php?act=member_exchange&op=receive_save',
					method: 'post',
					data: {
						"return_id":this.refundId				
					},
				}).then(function(res) {
					if(res.error_code==0){
						uni.showToast({
							title:"收货成功",
							success() {
								setTimeout(()=>{
									uni.navigateBack({
										delta:1
									})
								},1500)
							}
						})
					}else{
						uni.showToast({
							title:res.message,
							icon:"none"
						})
					}
				})
			},
			Towuliu(e){//查看物流
				uni.navigateTo({
					url:"/plug/logistics/info?return_id="+this.refundId+'&type='+e
				})
			},
			ToInfo(){//填写物流信息
				// alert(this.refundId)
				uni.navigateTo({
					url:"Logistics?return_id="+this.refundId+"&express_list="+this.express_list+"&Navindex="+1
				})
			},
			tab2(index,url){
				this.active2flag=index
				console.log(this.active2flag);
				uni.switchTab({
					url:url
				})
			}	
			
			
		}
	}
</script>

<style>
	.logisticsInfo{
		background-color: #ff4300;
		color: #FFFFFF;
		padding: 0 10rpx;
		border-radius: 10rpx;
		margin-left: 10rpx;
	}
	.complete{
		color: #BE024F;
	}
	.titleNview-placing {
		height: var(--status-bar-height);
		box-sizing: content-box;
	 }
	view{
		box-sizing: content-box;		
	}
	uni-page-body {
		background-color: #FFFFFF;
		color: rgb(102, 102, 102);
	}
	.titleNview-placing {
		height: var(--status-bar-height);
		box-sizing: content-box;
	 }
	.lh20{
		line-height: 20upx;
		height: 20upx;
	}
	.lh25{
		line-height: 25upx;
	}
	.lh30{
		line-height: 30upx;
	}
	.lh35{
		line-height: 35upx;
	}
	.lh40{
		line-height: 40upx;
	}
	.lh45{
		line-height: 45upx;
	}
	.lh50{
		line-height: 50upx;
	}
	.lh80{
		line-height: 80upx;
	}
	.lh100{
		line-height: 100upx;
	}
	.C000{
		color: #000000;
	}
	.Ce13d97{
		color: #ff4300;
	}
	.Cfe0000{
		color: #ff4300;
	}
	.Cc06{
		color: #ff4300;
	}
	.mt55mb30{
		margin-top: 55upx;
		margin-bottom: 30upx;
	}
	.Cfff{
		color: #FFFFFF;
	}
	
	.flex{		
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-content: space-between;
	}
	.paddingL20{
		padding-left: 20upx;
	}
	.C999{
		color:#999 ;
	}
	.Cff0101{
		color:#ff0101 ;
	}
	.Cc00251{
		color: #c00251;
	}
	.strick{
		text-decoration: line-through;
	}
	.Cfe0000{
		color: #ff4300;
	}
	.line1{
		width: 430upx;
	}
	.hide{
		display: none;
	}
	.marginB20{
		margin-bottom: 20upx;
	}
	.oneLine{
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	.twoline{
	   overflow : hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
	}
	.pl20{
		padding-left: 20upx;
	}
	.positionT{
		position: relative;
		top: 50upx;
	}
	.paddingB15{
		padding-bottom: 15upx;
	}
	.borderB{
		border-bottom: 1px solid #f4f4f6;
	}
	.borderT{
		border-top: 1px solid #f4f4f6;
	}
	.gl{
		position: absolute;
		right: 30upx;
	}
	.pr30{
		padding-right: 30upx;
	}
	.C333{
		color: #333333;
	}
	.C666{
		color: #666666;
	}
	.Cf00{
		color: #ff0000;
	}
	
	.bold{
		font-weight: bold;
	}
	.C1d1d1d{
		color:#1d1d1d ;
	}
	.fl{
		float: left;
	}
	.fr{
		float: right;
	}
	.tac{
		text-align: center;
	}
	.Ce5258e{
		color: #e5258e;
	}
	.Cccc{
		color: #CCCCCC;
	}
	.Cf7881c{
		color: #f7881c;
	}
	uni-page-body {
		background-color: #FFFFFF;
		color: rgb(102, 102, 102);
	}		
	.fs30{
		/* font-size: 30upx */
		font-size: 45upx
	}
	.fs26{
		font-size:39upx
		/* font-size: 26upx */
	}
	.fs12{
		font-size: 18upx
		/* font-size: 12upx */
	}
	.fs16{
		font-size: 24upx
		/* font-size: 16upx */
	}
	.fs14{
		font-size: 21upx
		/* font-size: 14upx */
	}
	.fs15{
		font-size: 22.5upx
		/* font-size: 15upx */
	}
	.fs27{
		font-size: 40.5upx
		/* font-size: 27upx */
	}
	.fs18{
		font-size: 27upx
		/* font-size: 18upx */
	}
	.fs28{
		font-size: 42upx
		/* font-size: 28upx */
	}
	.fs10{
		font-size: 15upx
		/* font-size: 10upx */
	}
	.fs30{
		font-size: 45upx
		/* font-size: 28upx */
	}
	.fs36{
		font-size: 54upx
		/* font-size: 28upx */
	}
	
	.fs24{
		font-size: 36upx
		/* font-size: 24upx */
	}
	.fs20{
		font-size:30upx
		/* font-size: 20upx */
	}
	.fs22{
		font-size:33upx
		/* font-size: 22upx */
	}
	.fs21{
		font-size: 31.5upx
		/* font-size: 21upx */
	}	
	.flexsb{
		display: flex;
		justify-content: space-between;
	}
	.plr20{
		padding: 0 20upx;
	}
	.plr10{
		padding: 0 10upx;
	}
	.f6f4f5{
		background-color: #fff;
	}	
	.Cf74d0f{
		color: #f74d0f;
	}
	.C2dc34d{
		color: #2dc34d;
	}
	.mt20{
		margin-top: 20upx;
	}
	.ti2{
		text-indent: 2em;
	}
	
	
	.content{
		min-height: 100vh;
		background-color: #f6f4f5;
	}
	

	.title{
		padding-left: 20upx;
		background-color: #fff;
		padding-top: 30upx;
		border-bottom: 1upx solid #f1f1f1;
	}
	.process{		
		padding: 30upx 15upx;
		background-color: #fff;
		box-sizing: border-box;
	}
	.circles{
		margin-top: 20upx;
		padding: 0 20upx;
	}
	.line{
		position: relative;
		z-index: 0;
		top: 40upx;
		width: 650upx;
		height: 2upx;
		margin: 0 auto;
	}
	.processTitle view.processActive{
		color: #ff4300;
	}
	.processTitle view{
		width: 120upx;
		text-align: center;
		line-height: 40upx;
	}
	.tousuContent{
		box-sizing: border-box;
		margin-top: 20upx;
		background-color: #fff;
	}
	.title2{
		padding-left: 20upx;
		height: 70upx;
		line-height: 90upx;
		border-bottom: 1upx solid #f1f1f1;
	}
	.commonLi{
		padding: 20upx;
	}
	.commonLi image+image{
		margin-left: 33upx;
	}
	.commonTitle{
		height: 56upx;
		line-height: 56upx;
		padding-left: 30upx;
	}
	.commonBox{
		padding:30upx 24upx ;
		background-color: #fff;
	}
	.commonTip{
		box-sizing: border-box;
		padding:10upx 30upx;		
	}
	.content{
		padding-bottom: 200upx;
	}
	.flexBox{
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
</style>

